Optimal. Leaf size=156 \[ \frac{\left (48 a^2+16 a b+3 b^2\right ) \sin (e+f x) \cos ^3(e+f x)}{192 f}+\frac{\left (48 a^2+16 a b+3 b^2\right ) \sin (e+f x) \cos (e+f x)}{128 f}+\frac{1}{128} x \left (48 a^2+16 a b+3 b^2\right )-\frac{b (10 a+3 b) \sin (e+f x) \cos ^5(e+f x)}{48 f}-\frac{b \sin (e+f x) \cos ^7(e+f x) \left ((a+b) \tan ^2(e+f x)+a\right )}{8 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.149702, antiderivative size = 156, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.217, Rules used = {3191, 413, 385, 199, 203} \[ \frac{\left (48 a^2+16 a b+3 b^2\right ) \sin (e+f x) \cos ^3(e+f x)}{192 f}+\frac{\left (48 a^2+16 a b+3 b^2\right ) \sin (e+f x) \cos (e+f x)}{128 f}+\frac{1}{128} x \left (48 a^2+16 a b+3 b^2\right )-\frac{b (10 a+3 b) \sin (e+f x) \cos ^5(e+f x)}{48 f}-\frac{b \sin (e+f x) \cos ^7(e+f x) \left ((a+b) \tan ^2(e+f x)+a\right )}{8 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3191
Rule 413
Rule 385
Rule 199
Rule 203
Rubi steps
\begin{align*} \int \cos ^4(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a+(a+b) x^2\right )^2}{\left (1+x^2\right )^5} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{b \cos ^7(e+f x) \sin (e+f x) \left (a+(a+b) \tan ^2(e+f x)\right )}{8 f}+\frac{\operatorname{Subst}\left (\int \frac{a (8 a+b)+(a+b) (8 a+3 b) x^2}{\left (1+x^2\right )^4} \, dx,x,\tan (e+f x)\right )}{8 f}\\ &=-\frac{b (10 a+3 b) \cos ^5(e+f x) \sin (e+f x)}{48 f}-\frac{b \cos ^7(e+f x) \sin (e+f x) \left (a+(a+b) \tan ^2(e+f x)\right )}{8 f}+\frac{\left (48 a^2+16 a b+3 b^2\right ) \operatorname{Subst}\left (\int \frac{1}{\left (1+x^2\right )^3} \, dx,x,\tan (e+f x)\right )}{48 f}\\ &=\frac{\left (48 a^2+16 a b+3 b^2\right ) \cos ^3(e+f x) \sin (e+f x)}{192 f}-\frac{b (10 a+3 b) \cos ^5(e+f x) \sin (e+f x)}{48 f}-\frac{b \cos ^7(e+f x) \sin (e+f x) \left (a+(a+b) \tan ^2(e+f x)\right )}{8 f}+\frac{\left (48 a^2+16 a b+3 b^2\right ) \operatorname{Subst}\left (\int \frac{1}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{64 f}\\ &=\frac{\left (48 a^2+16 a b+3 b^2\right ) \cos (e+f x) \sin (e+f x)}{128 f}+\frac{\left (48 a^2+16 a b+3 b^2\right ) \cos ^3(e+f x) \sin (e+f x)}{192 f}-\frac{b (10 a+3 b) \cos ^5(e+f x) \sin (e+f x)}{48 f}-\frac{b \cos ^7(e+f x) \sin (e+f x) \left (a+(a+b) \tan ^2(e+f x)\right )}{8 f}+\frac{\left (48 a^2+16 a b+3 b^2\right ) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{128 f}\\ &=\frac{1}{128} \left (48 a^2+16 a b+3 b^2\right ) x+\frac{\left (48 a^2+16 a b+3 b^2\right ) \cos (e+f x) \sin (e+f x)}{128 f}+\frac{\left (48 a^2+16 a b+3 b^2\right ) \cos ^3(e+f x) \sin (e+f x)}{192 f}-\frac{b (10 a+3 b) \cos ^5(e+f x) \sin (e+f x)}{48 f}-\frac{b \cos ^7(e+f x) \sin (e+f x) \left (a+(a+b) \tan ^2(e+f x)\right )}{8 f}\\ \end{align*}
Mathematica [A] time = 0.317676, size = 96, normalized size = 0.62 \[ \frac{24 \left (48 a^2+16 a b+3 b^2\right ) (e+f x)+24 \left (4 a^2-4 a b-b^2\right ) \sin (4 (e+f x))-32 a b \sin (6 (e+f x))+96 a (8 a+b) \sin (2 (e+f x))+3 b^2 \sin (8 (e+f x))}{3072 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.055, size = 167, normalized size = 1.1 \begin{align*}{\frac{1}{f} \left ({b}^{2} \left ( -{\frac{ \left ( \sin \left ( fx+e \right ) \right ) ^{3} \left ( \cos \left ( fx+e \right ) \right ) ^{5}}{8}}-{\frac{\sin \left ( fx+e \right ) \left ( \cos \left ( fx+e \right ) \right ) ^{5}}{16}}+{\frac{\sin \left ( fx+e \right ) }{64} \left ( \left ( \cos \left ( fx+e \right ) \right ) ^{3}+{\frac{3\,\cos \left ( fx+e \right ) }{2}} \right ) }+{\frac{3\,fx}{128}}+{\frac{3\,e}{128}} \right ) +2\,ab \left ( -1/6\,\sin \left ( fx+e \right ) \left ( \cos \left ( fx+e \right ) \right ) ^{5}+1/24\, \left ( \left ( \cos \left ( fx+e \right ) \right ) ^{3}+3/2\,\cos \left ( fx+e \right ) \right ) \sin \left ( fx+e \right ) +1/16\,fx+e/16 \right ) +{a}^{2} \left ({\frac{\sin \left ( fx+e \right ) }{4} \left ( \left ( \cos \left ( fx+e \right ) \right ) ^{3}+{\frac{3\,\cos \left ( fx+e \right ) }{2}} \right ) }+{\frac{3\,fx}{8}}+{\frac{3\,e}{8}} \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.47152, size = 228, normalized size = 1.46 \begin{align*} \frac{3 \,{\left (48 \, a^{2} + 16 \, a b + 3 \, b^{2}\right )}{\left (f x + e\right )} + \frac{3 \,{\left (48 \, a^{2} + 16 \, a b + 3 \, b^{2}\right )} \tan \left (f x + e\right )^{7} + 11 \,{\left (48 \, a^{2} + 16 \, a b + 3 \, b^{2}\right )} \tan \left (f x + e\right )^{5} +{\left (624 \, a^{2} + 80 \, a b - 33 \, b^{2}\right )} \tan \left (f x + e\right )^{3} + 3 \,{\left (80 \, a^{2} - 16 \, a b - 3 \, b^{2}\right )} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{8} + 4 \, \tan \left (f x + e\right )^{6} + 6 \, \tan \left (f x + e\right )^{4} + 4 \, \tan \left (f x + e\right )^{2} + 1}}{384 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.30418, size = 278, normalized size = 1.78 \begin{align*} \frac{3 \,{\left (48 \, a^{2} + 16 \, a b + 3 \, b^{2}\right )} f x +{\left (48 \, b^{2} \cos \left (f x + e\right )^{7} - 8 \,{\left (16 \, a b + 9 \, b^{2}\right )} \cos \left (f x + e\right )^{5} + 2 \,{\left (48 \, a^{2} + 16 \, a b + 3 \, b^{2}\right )} \cos \left (f x + e\right )^{3} + 3 \,{\left (48 \, a^{2} + 16 \, a b + 3 \, b^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{384 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 18.2245, size = 481, normalized size = 3.08 \begin{align*} \begin{cases} \frac{3 a^{2} x \sin ^{4}{\left (e + f x \right )}}{8} + \frac{3 a^{2} x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{4} + \frac{3 a^{2} x \cos ^{4}{\left (e + f x \right )}}{8} + \frac{3 a^{2} \sin ^{3}{\left (e + f x \right )} \cos{\left (e + f x \right )}}{8 f} + \frac{5 a^{2} \sin{\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{8 f} + \frac{a b x \sin ^{6}{\left (e + f x \right )}}{8} + \frac{3 a b x \sin ^{4}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{8} + \frac{3 a b x \sin ^{2}{\left (e + f x \right )} \cos ^{4}{\left (e + f x \right )}}{8} + \frac{a b x \cos ^{6}{\left (e + f x \right )}}{8} + \frac{a b \sin ^{5}{\left (e + f x \right )} \cos{\left (e + f x \right )}}{8 f} + \frac{a b \sin ^{3}{\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{3 f} - \frac{a b \sin{\left (e + f x \right )} \cos ^{5}{\left (e + f x \right )}}{8 f} + \frac{3 b^{2} x \sin ^{8}{\left (e + f x \right )}}{128} + \frac{3 b^{2} x \sin ^{6}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{32} + \frac{9 b^{2} x \sin ^{4}{\left (e + f x \right )} \cos ^{4}{\left (e + f x \right )}}{64} + \frac{3 b^{2} x \sin ^{2}{\left (e + f x \right )} \cos ^{6}{\left (e + f x \right )}}{32} + \frac{3 b^{2} x \cos ^{8}{\left (e + f x \right )}}{128} + \frac{3 b^{2} \sin ^{7}{\left (e + f x \right )} \cos{\left (e + f x \right )}}{128 f} + \frac{11 b^{2} \sin ^{5}{\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{128 f} - \frac{11 b^{2} \sin ^{3}{\left (e + f x \right )} \cos ^{5}{\left (e + f x \right )}}{128 f} - \frac{3 b^{2} \sin{\left (e + f x \right )} \cos ^{7}{\left (e + f x \right )}}{128 f} & \text{for}\: f \neq 0 \\x \left (a + b \sin ^{2}{\left (e \right )}\right )^{2} \cos ^{4}{\left (e \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.14959, size = 146, normalized size = 0.94 \begin{align*} \frac{1}{128} \,{\left (48 \, a^{2} + 16 \, a b + 3 \, b^{2}\right )} x + \frac{b^{2} \sin \left (8 \, f x + 8 \, e\right )}{1024 \, f} - \frac{a b \sin \left (6 \, f x + 6 \, e\right )}{96 \, f} + \frac{{\left (4 \, a^{2} - 4 \, a b - b^{2}\right )} \sin \left (4 \, f x + 4 \, e\right )}{128 \, f} + \frac{{\left (8 \, a^{2} + a b\right )} \sin \left (2 \, f x + 2 \, e\right )}{32 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]